package com.nc.delivery_project.client.users;

import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.google.gwt.place.shared.Prefix;
import com.google.web.bindery.requestfactory.shared.RequestFactory;

/**
 * Created by miroshnik on 12/28/2014.
 */
public class UsersPlace extends Place {
    
    @Prefix("users")
    public static class Tokenizer implements PlaceTokenizer<UsersPlace> {

        private RequestFactory requestFactory;

        public Tokenizer(RequestFactory requestFactory) {
            this.requestFactory = requestFactory;
        }

        @Override
        public String getToken(UsersPlace place) {
            return place.getToken();
        }

        @Override
        public UsersPlace getPlace(String token) {
            return new UsersPlace(token);
        }

    }

    private String token;

    public UsersPlace(String token) {
        this.token = token;
    }

    public String getToken() {
        return token;
    }

}
